obj-m := hid-logitech-hidpp.o

# Embed a build-time identifier the loaded module prints on module_init,
# so users on a "did my fix actually take effect?" hunt can read it back
# from dmesg / `modinfo` (issue #17). Resolution order:
#   1. .git_hash file dropped into the source dir by tools/dkms-update.sh
#   2. live `git rev-parse` if the source dir is itself a git checkout
#      (in-tree developer build via `make` on the repo)
#   3. literal "unknown" so the build still succeeds for tarballs etc.
GIT_HASH := $(shell cat $(src)/.git_hash 2>/dev/null || git -C $(src) rev-parse --short HEAD 2>/dev/null || echo unknown)
ccflags-y += -DRS50_GIT_HASH=\"$(GIT_HASH)\"

# Opt-in dev-only raw HID++ shell at /sys/.../wheel_hidpp_debug.
# Enable with: make DEBUG=1
ifdef CONFIG_HID_LOGITECH_HIDPP_DEBUG
ccflags-y += -DCONFIG_HID_LOGITECH_HIDPP_DEBUG
endif
